<div id="view-content">
	<?php include_once '/../supMenu.html';?>
	<h2 class="backend-h2"><span class="img"></span><span> Kiểm tra</span>
    </h2>
    <p class="saporator"><br /></p>
    
    <div class="question">
			<h2 class="quiz-title">Danh sách câu hỏi</h2>
			<form action="<?php echo $this->baseUrl('/admin/quiz/addquestion'); ?>" method="post">
				<p class="quiz-mon"><span>Ngân hàng câu hỏi môn</span>
					<select name="cbbMon">
					<?php 
						foreach ($this->listMonHoc as $monHoc) {
							if(isset($_REQUEST['cbbMon']) && $_REQUEST['cbbMon']==$monHoc['id']){
								echo '<option value="'.$monHoc['id'].'" selected="selected">'.$monHoc['tenMonHoc'].'</option>';
							}else{
								echo '<option value="'.$monHoc['id'].'">'.$monHoc['tenMonHoc'].'</option>';
							}
						}
					?>
					</select>
					<input type="submit" name="cmdViewMon" value="Xem" class="submit" />
				</p>
			
				<table>
					<thead>
						<tr>
							<th class="col-1-listQuiz" ><input type="checkbox"  class="check-all" /></th>
							<th class="col-2-listQuiz">STT</th>
							<th class="col-3-listQuiz">Tên</th>
						</tr>
					</thead>
				</table>
				
				<div style="overflow: auto; height: 320px;">
				<table>
					<tbody>
					<?php $i=0; 
						foreach ($this->paginatorListQuestion as $question) {
							$i++;
					?>
						<tr>
							<th class="col-1-listQuiz col-content">
								<input type="checkbox" name="cb_listQuestion[]" class="sub-check" value="<?php echo $question['idCauHoi'];?>"/>
							</th>
							<th class="col-2-listQuiz"><?php echo $i;?></th>
							<th class="col-3-listQuiz post_title col-content">
		                    	<strong><a href="" class="title_ct"><?php echo $question['tenCauHoi']; ?></a></strong> 
			                    <div class="row_action">
			                        <span class="row_edit">
			                        	<a href="<?php echo $this->baseUrl('/admin/question/?edit&id='.$question['idCauHoi']);?>">Sửa</a>|
			                        </span>
			                        <span class="row_del">
			                        	<a href="<?php echo $this->baseUrl('/admin/question/delete/?delete&id='.$question['idCauHoi']);?>">Xóa</a>
			                        </span>                        
			                    </div>
		                    </th>
						</tr>
					<?php }?>
					</tbody>
				</table>
				</div>
				<?php echo $this->paginationControl($this->paginatorListQuestion,'sliding','paginatorQuestion.phtml');?>
				<br />
				<input type="submit" name="btAddToQuiz" value="Thêm vào bài test" class="addToQuiz input-hover submit" />
				<input type="submit" name="cmdAddQues" value="Thêm mới" class="input-hover submit"/>
				<input type="submit" name="cmdDelQues" value="Xóa" class="input-hover submit"/>
			</form>
	</div>
    
    <p class="saporator"><br /></p>
    
	<div class="quiz">
		<h2 class="quiz-title">Bài test</h2>
		<div class="list-quiz">
			<h4 class="quiz-subTitle">Danh sách bài test</h4>
			<form action="<?php echo $this->baseUrl('/admin/quiz/addquestion')?>" method="post">
				<table>
					<thead>
						<tr>
							<th class="col-1-listQuiz" ><input type="checkbox"  class="check-all-list" /></th>
							<th class="col-2-listQuiz">STT</th>
							<th class="col-3-listQuiz">Tên</th>
						</tr>
					</thead>
					<tbody>
					<?php 
					if(isset($this->paginatorListExame)){
						$i=0; 
						foreach ($this->paginatorListExame as $listExame) {
							$i++;
					?>
						<tr>
							<th class="col-1-listQuiz">
								<input type="checkbox" name="cb_listQuiz[]" class="sub-check-list" value="<?php echo $listExame['idKiemTra'];?>"/>
							</th>
							<th class="col-1-listQuiz"><?php echo $i;?></th> 
							<th class="col-3-listQuiz post_title col-content">
		                    	<strong><a href="" class="title_ct"><?php echo $listExame['ten']; ?></a></strong> 
			                    <div class="row_action">
			                        <span class="row_edit">
			                        	<a href="<?php echo $this->baseUrl('/admin/quiz/add/?editlist&id='.$listExame['idKiemTra']);?>">Sửa</a>|
			                        </span>
			                        <span class="row_del">
			                        	<a href="<?php echo $this->baseUrl('/admin/quiz/delete/?deletelist&id='.$listExame['idKiemTra']);?>">Xóa</a>
			                        </span>                        
			                    </div>
		                    </th>
						</tr>
					<?php }
					}
					?>
					</tbody>
					
					<tfoot>
						<tr>
							<th class="col-1-listQuiz" ><input type="checkbox"  class="check-all-list" /></th>
							<th class="col-2-listQuiz">STT</th>
							<th class="col-3-listQuiz">Tên</th>
						</tr>
					</tfoot>
				</table>
				<?php if(isset($this->paginatorExame)) echo $this->paginationControl($this->paginatorListExame,'sliding','paginatorExame.phtml');?>
				<br />
				<input type="submit" name="cmdAddQuiz" value="Thêm" class="input-hover submit" />
				<input type="submit" name="cmdChoose" value=">>" class="input-hover submit" />
				
			</form>
		</div><!-- end .list-quiz -->
		
		<div class="choose-quiz">
			<h4 class="quiz-subTitle"> Bài test</h4>
			<p><?php if(isset($this->exameName)) echo $this->exameName;?></p>
			<form action="<?php echo $this->baseUrl('/admin/quiz/delete')?>" method="post" >
				<table>
					<thead>
						<tr>
							<th class="col-1-chooseQuiz"><input type="checkbox" class="check-all-choose" /></th>
							<th class="col-2-chooseQuiz">STT</th>
							<th class="col-3-chooseQuiz">Câu hỏi</th>
						</tr>
					</thead>
					<tbody>
					<?php
					$i=1;
					if(isset($this->paginatorExame)){ 
						foreach ($this->paginatorExame as $exame) {
					 ?>
						<tr>
							<th class="col-1-chooseQuiz">
								<input type="checkbox" name="cbChooseQuiz[]" value="<?php echo $exame['idCauHoi']?>" class="sub-check-choose" />
							</th>
							<th class="col-2-chooseQuiz"><?php echo $i;?></th>
							<th class="col-2-chooseQuiz post_title col-content">
		                    	<strong><a href="" class="title_ct">
		                    		<?php echo $exame['tenCauHoi']; ?></a>
		                    	</strong> 
			                    <div class="row_action">
			                        <span class="row_del">
			                        	<a href="<?php echo $this->baseUrl('/admin/quiz/delete/?deleteexame&id='.$exame['idCauHoi']);?>">Xóa</a>
			                        </span>                        
			                    </div>
		                    </th>
						</tr>
					<?php 
							$i++; 
						}
					}
					?>
					</tbody>
					<tfoot>
						<tr>
							<th class="col-1-chooseQuiz"><input type="checkbox" class="check-all-choose" /></th>
							<th class="col-2-chooseQuiz">STT</th>
							<th class="col-3-chooseQuiz">Câu hỏi</th>
						</tr>
					</tfoot>
				</table>
				<?php if(isset($this->paginatorExame)) echo $this->paginationControl($this->paginatorExame,'sliding','tinyPaginator.phtml');?>
				
				<br />
				<input type="submit" name="cmdDelQuestionInExame" value="Xóa" class="input-hover" />
			</form>
		</div><!-- end .choose-quiz -->
		
	</div><!-- end .quiz -->
	
	<div id="ddd">
		<script type="text/javascript">
//		xmlhttp.open('GET', '/quiz/d/format/html', true);
//			$(document).ready(function(){
//				$("#ddd").load("/quiz/d/?format=html");
//			});
		</script>
	</div> 
	
</div>